cmake_minimum_required(VERSION 3.16.0)
project(studycpp VERSION 0.1.0)

include(CTest)
enable_testing()

find_package(glfw3)
find_package(OpenGL)
set(INCLUDE_DIR "${CMAKE_SOURCE_DIR}/include")
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
    list(APPEND INCLUDE_DIR "C:/Program Files/Git/mingw64/include")
    set(LinkLibs
            glfw3
            OpenGL32
            )
else()
    set(LinkLibs
            glfw
            dl
            OpenGL)
endif ()
include_directories(${INCLUDE_DIR})
add_executable(studycpp main.cpp
    src/glad.c
    src/shader.cpp
)

########### get all variables ###############
get_cmake_property(_variableNames VARIABLES)
foreach (_variableName ${_variableNames})
    message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
#############################################

target_link_libraries(studycpp
    ${LinkLibs}
)
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}")
set(RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}")
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
